;; add plugins downloaded from the web to my load path
(labels ((add-path (p)
		   (add-to-list 'load-path
				(concat plugins-dir p))))
  (add-path "yasnippet-0.6.1c") ;; Yasnippet support
  )

(autoload 'filladapt-mode "filladapt" "Filladapt mode." t)

(autoload 'flyspell-mode "flyspell" "Flyspell mode." t)

(autoload 'auto-update-file-header "header2" "Update file header." t)

(autoload 'make-header "header2"
  "Insert (mode-dependent) header comment at beginning of file." t)
(defun def-header ()  ;; set default date-format and make-header-hook
  (setq header-date-format nil
	make-header-hook '(
			   header-title
			   header-blank
			   header-author
			   header-modification-date
			   header-blank
			   header-description
			   )))
(def-header)
(add-hook 'write-file-hooks 'auto-update-file-header)

(autoload 'word-count-mode "word-count" "Minor mode to count words." t nil)

(eval-after-load "ispell"
  '(progn
     ;; Use the -C option when running aspell, which will
     ;; ConsiderCamelCaseToBeCorrect
     (setq ispell-extra-args '("-C"))))


;; programming language support
(autoload 'nxml-mode "nxml-mode" "NXML Mode" t)
(autoload 'actionscript-mode "actionscript-mode" "Actionscript Mode" t)
(autoload 'OpenGL-minor-mode "opengl minor mode" "OpenGL editing utilities." t)
(autoload 'graphviz-dot-mode "graphviz-dot mode" "Graphviz-dot Mode" t)
(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
(add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))
(autoload 'gnuplot-mode "gnuplot" "Gnuplot Major Mode" t)
(autoload 'gnuplot-make-buffer "gnuplot" "Open a buffer in gnuplot-mode" t)
(load-library "haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
(autoload 'javascript-mode "javascript" nil t)
(autoload 'guru-mode "guru-mode" "Guru Mode" t)
(autoload 'lustre-mode "lustre" "Lustre Mode" t)
(autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
(autoload 'camldebug "camldebug" "Run the Caml debugger" t)

;; project support via mk-project (https://github.com/mattkeller/mk-project)
(require 'mk-project)

;; YASnippet is a template system for Emacs. It allows you to type an
;; abbreviation and automatically expand it into function templates.
(require 'yasnippet)
(yas/initialize)
(yas/load-directory (concat plugins-dir "yasnippet-0.6.1c/snippets"))

;; scala-mode
(require 'scala-mode-auto)